<?php 
if( !defined('IN') )
	define('IN', TRUE);

	require_once 'common.php';
	
	$tabdata = $enchersObj->getEncheresTerminees();
	if(!empty($tabdata)){
		foreach ($tabdata as $data) {
			$data['pc']=$data['limite']==0?'b':'';
			if( !isset($data['ae']) || $data['ae'] == 0 ) $data['ae'] = 'b';
				$data['AE'] = 'AE';
			if(!empty($data['images'])){
			   $data['images'] = array_shift(explode(';', $data['images']));
			}
			$val = $data['retime'];
			$data['retime'] =( $val == 60?'1min':($val == 120?'2min':($val == 300?'5min':$val.'s')));
			$data['pseudo'] = (($data['pseudo']!=null)?$data['pseudo']:'Aucun');
?>
	<div class="termine">
		<div class="icons">
			<div class="icon"><span class="rt"><?php  echo $data['retime']; ?></span></div>
			<div class="icon"><span class="pc<?php  echo $data['pc']; ?>"><?php  echo $data['limite']; ?>%</span></div>
			<div class="icon"><span class="ae<?php  echo $data['ae']; ?>"><?php  echo $data['AE']; ?></span></div>
		</div>
		<div style="text-align:center;">
		<div class="titre"><?php  echo $data['nom']; ?></div>
		<div class="image">
			<a href="detail-product-<?php  echo $data['id']; ?>.html"><div class="gagne"></div>
				<img src="<?php  echo _UPLOAD_DIR_ ?>encheres/small<?php  echo $data['images']; ?>" alt="<?php  echo $data['nom']; ?>" title="<?php  echo $data['nom']; ?>" />
			</a>
		</div>
		<div class="encherir"><img src="<?php  echo _THEME_IMG_DIR_ ?>bt-termine.jpg" alt="Termin&eacute;" /></div>
			<div class="infos">
				<span class="prix"><?php  echo $data['enchere']; ?> <?php  echo $site->getDevise(); ?></span>
				<span class="meneur"><?php echo _GAGNANT_ ?></span> <span class="pseudo"><?php  echo $data['pseudo']; ?></span>
			</div>
		</div>
	</div>
<?php }
	}else echo '<div class="termine"><p>'._AUCUNE_ENCHERE_TERMINEE_.'</p></div>';
?>